package com.ef.service.impl;

import com.ef.constant.StatusType;
import com.ef.dao.CorpContractDao;
import com.ef.domain.CorpContract;
import com.ef.service.CorpContractService;
import com.ef.util.CustomExample;
import com.ef.util.PaginationSupport;

public class CorpContractServiceImpl extends BaseServiceImpl implements
		CorpContractService {

	private CorpContractDao corpContractDao;

	public void delete(CorpContract entity) {
		entity.setStatus(StatusType.INVALID);
		corpContractDao.update(entity);
	}

	public PaginationSupport<CorpContract> findByExample(
			CustomExample<CorpContract> example, int startIndex, int pageSize) {

		return corpContractDao.findPageByExample(example, startIndex, pageSize);
	}

	public CorpContract findById(Long id) {

		return corpContractDao.findById(id);
	}

	public void saveOrUpdate(CorpContract entity) {
		corpContractDao.clear();
		corpContractDao.saveOrUpdate(entity);
	}

	public CorpContractDao getCorpContractDao() {
		return corpContractDao;
	}

	public void setCorpContractDao(CorpContractDao corpContractDao) {
		this.corpContractDao = corpContractDao;
	}
}
